/* eslint-disable */
import defaultreq from '@/utils/request'
import store from '@/store'
export const login =data =>{
    return defaultreq({
        method:'POST',
        // url:'http://localhost:8080/app/v1_0/authorizations',
        url:'/v1_0/authorizations',
        data,
    }) 
}
export const sendsms =mobile =>{
    return defaultreq({
        method:'GET',
        // url:'http://localhost:8080/app/v1_0/authorizations',
        url:`/v1_0/sms/codes/${mobile}`,
        
    }) 
}
export const getuser=()=>{
    return defaultreq({
        method:'GET',
        // url:'http://localhost:8080/app/v1_0/authorizations',
        url:`/v1_0/user`,
    }) 
}
export const getuserprofile=()=>{
    return defaultreq({
        method:'GET',
        url:`/v1_0/user/profile`,
    }) 
}
export const setuserprofile=(data)=>{
    return defaultreq({
        method:'PATCH',
        url:`/v1_0/user/profile`,
        data
    }) 
}
//设置用户头像
export const setuserphoto=(data)=>{
    return defaultreq({
        method:'PATCH',
        url:`/v1_0/user/photo`,
        data
    }) 
}
//获取用户历史记录
export const getuserhistory=(params)=>{
    return defaultreq({
        method:'GET',
        url:`/v1_0/user/histories`,
        params
    }) 
}
// 用户收藏列表
export const getuserfavorites=(params)=>{
    return defaultreq({
        method:'GET',
        url:`/v1_0/article/collections`,
        params
    }) 
}
// 用户关注列表
export const getuserfocus=(params)=>{
    return defaultreq({
        method:'GET',
        url:`/v1_0/user/followings`,
        params
    }) 
}
// 用户粉丝列表
export const getuserfans=(params)=>{
    return defaultreq({
        method:'GET',
        url:`/v1_0/user/followers`,
        params
    }) 
}
